getOneAdmin();
var userId="";
function getOneAdmin() {
	$.ajax({
		url: urlcore + "/api/userAccount/selectAccount",
		type: "get",
		dataType: 'json',
		contentType: "application/json;charset=utf-8",
		success:function(data){
			if (data.success == true) {
			//	userId=data.data.id;
            //  selectshopinfoone(data.data.id);	
             $("#yijiaona").text(data.data.blockMoney);	
			} else{
               window.location.href="../index.html";
			}
		},
		error:function() {
			/* Act on the event */
			alert("error");
		}
	});	
}




//logout();
function logout() {
	$.ajax({
		url: urlcore + "/api/login/logout",
		type: "get",
		dataType: 'json',
		contentType: "application/json;charset=utf-8",
		success: function(data) {},
		error: function() {
			alert("error");
		}
	});
}

 function chaxunbaozhengjing(){
	  $("#xianyoujinge").html("");
	$.ajax({
		url: urlcore + "/api/shopInfo/selectsShopDeposituserid?userId="+userId,
		type: "get",
		dataType: 'json',
		contentType: "application/json;charset=utf-8",
		success:function(data){
			if (data.success == true) {
				
				$("#xianyoujinge").html(data.data);
			}
		},
		error:function() {
			/* Act on the event */
			alert("error");
		}
	});	
}
	function selectshopinfoone(ids){
		$.ajax({
 url: urlcore + "/api/shopInfo/selectagno1?id="+ids,
			type: "get",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success: function(data) {
				if(data.success == true) {
					if(data.data!=null){
						  	 $("#yijiaona").text(data.data.shopDeposit);					
					}else{
						alert("未开通店铺请开通");
						window.location.href="13.0.0mianfeikaidian.html";
					}
				} else if(data.code == 'OVERTIME') {
					var thisUrl = window.location.href;
					alert(thisUrl);
					if(thisUrl.indexOf('1.0.0denglu.html') <= -1) {
						top.window.location.href = "1.0.0denglu.html";
					}
				} else {
					if(data.msg != '空数据') {
						alert(data.msg)
					} else {
						$('#thiscount').text(0);
					}
				}

			},
			error: function() {
				alert("error");
			}
		});
		}
			
			

//jiao na

function tuifei(){
	if(uuuuid!=""){
		var tuifeijinge=$("#tuifeijinge").val();
	    $.ajax({  
        url : urlcore + "/api/shopInfo/updateShopDeposit",
        type : "post",  
        contentType: "application/json;charset=utf-8",
        data :  JSON.stringify({
        	userId:uuuuid,
        	isPayThaw:1,
        	shopDeposit:tuifeijinge
        }),
        	dataType: "json",
        success: function(data) {//data是返回的hash,key之类的值，key是定义的文件名 
        	window.location.href = document.referrer
        },
        error:function(){  
            alert("erer");  
        }  
    });     
	     }
}

function jiedong(){
	if(uuuuid!=""){
		var tuifeijinge=$("#tuifeijinge2").val();
	    $.ajax({  
        url : urlcore + "/api/shopInfo/updateShopDeposit",
        type : "post",  
        contentType: "application/json;charset=utf-8",
        data :  JSON.stringify({
        	userId:uuuuid,
        	isPayThaw:0,
        	shopDeposit:tuifeijinge
        }),
        	dataType: "json",
        success: function(data) {//data是返回的hash,key之类的值，key是定义的文件名 
        	window.location.href = document.referrer
        },
        error:function(){  
            alert("erer");  
        }  
    });     
	     }
}


function jiaona(){
window.location.href="../12.3.0dianpujiaona.html";
}
